<template>
  <el-table :height="calTableHeight() - 50" ref="TableRef" :data="data">
    <el-table-column type="index" :label="$t('序号')" width="60" align="center" />
    <el-table-column show-overflow-tooltip width="360" :label="$t('提现日期范围')" align="center" prop="orderNo">
      <template slot-scope="{ row }"> {{ row.withdrawStartTime }}至{{ row.withdrawEndTime }} </template>
    </el-table-column>
    <el-table-column :label="$t('提现金额')" align="center" prop="amount">
      <template #default="{ row }">
        <div>{{ row.amount | thousand }}</div>
      </template>
    </el-table-column>
    <el-table-column :label="$t('是否汇款')" align="center" prop="skuId">
      <template slot-scope="{ row }">
        <span v-if="row.isRemit == 0"> 未汇款 </span>
        <span v-else-if="row.isRemit == 1">已汇款</span>
      </template>
    </el-table-column>
    <el-table-column :label="$t('创建时间')" align="center" prop="createTime" />
  </el-table>
</template>
<script>
import handleTableSum from '@/utils/handleSum'

export default {
  activated() {
    this.$nextTick(() => this.$refs['TableRef']?.doLayout())
  },
  props: {
    /**
     * data
     */
    data: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {}
  },
  methods: {
    handleSum(param) {
      /**
       * 需要进行统计的字段
       */
      const data = handleTableSum(param, ['profitLoss'], '合计', 0)
      console.log(`data ==>`, JSON.parse(JSON.stringify(data)))
      return data
    },

    cancel() {
      this.$emit('update:show', false)
    },
  },
}
</script>
